<include file="public@header"/>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">
            <h3>{:lang('PORTAL_ADMINSENSITIVE_INDEX')}</h3>
        </div>
        <div class="layui-card-body">
            <form class="form-search layui-form-item clearfix" method="post" action="{:url('AdminSensitive/index')}">
                <div class="layui-col-xs6">
                    <div class="layui-inline">
                        <input type="text" class="layui-input" name="keyword" 
                           value="{$keyword|default=''}" placeholder="{:lang('PLEASE_ENTER_KEYWORD')}">
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn layui-btn-normal">{:lang('SEARCH')}</button>
                    </div>
                </div>

                <div class="layui-col-xs6 text-right">
                    <!-- 添加 -->
                    <if condition="in_array('add', $actions)">
                        <a href="{:url('AdminSensitive/add')}" class="layui-btn layui-btn-normal">{:lang('PORTAL_ADMINSENSITIVE_ADD')}</a>
                    </if>
                </div>
            </form>
        </div>

        <form method="post" class="js-ajax-form margin-top-20">
            
            <table class="layui-table">
                <thead>
                <tr>
                    <th width="50">ID</th>
                    <th>敏感词</th>
                    <th>替换词</th>
                    <th>{:lang('ADD_TIME')}</th>
                    <th>添加人</th>
                    <th width="160">{:lang('ACTIONS')}</th>
                </tr>
                </thead>
                <tbody>
                <foreach name="sensitive" item="vo">
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.name}</td>
                        <td>{$vo.displace}</td>
                        
                        <td>{:date('Y-m-d H:i',$vo['add_time'])}</td>

                        <td>{$vo.user_login}</td>
                        <td>
                            <if condition="in_array('edit', $actions)">
                                <a href="{:url('AdminSensitive/edit',array('id'=>$vo['id']))}" class="layui-btn layui-btn-xs">{:lang('EDIT')}</a>
                            </if>
                            <if condition="in_array('delete', $actions)">
                                <a class="js-ajax-delete layui-btn layui-btn-danger layui-btn-xs" href="{:url('AdminSensitive/delete',['id'=>$vo['id']])}">{:lang('DELETE')}</a>
                            </if>
                        </td>
                    </tr>
                </foreach>
                </tbody>
            </table>

            <div class="table-actions">
                <!--<button type="submit" class="layui-btn layui-btn-normal btn-sm js-ajax-submit">{:lang('SORT')}</button>-->
            </div>
        </form>

        <if condition="$page">
            <div class="pagination-row clearfix">
                <div class="pages">{$page|default=''}</div>
            </div>
        </if>
    </div>
</div>
<include file="public@footer"/>
